import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:flutter_wan_android/routes/route_handler.dart';

class Routes {
  static String root = "/";
  static String web = "/web_page";
  static String index = "/index";
  static String setting = "/setting";
  static String todo = "/todo";
  static String myPoint = "/my_point";
  static String myCollect = "/my_collect";
  static String login = "/login";
  static String txList = "/tx_list";
  static String search = "/search";

  static void configureRoutes(FluroRouter router) {

    router.notFoundHandler = new Handler(
        handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
         print("ROUTE WAS NOT FOUND !!!");
    });

    /// 第一个参数是路由地址，第二个参数是页面跳转和传参，第三个参数是默认的转场动画
    router.define(root, handler: rootHandler, transitionType: TransitionType.cupertino);
    router.define(index, handler: indexHandler, transitionType: TransitionType.fadeIn);
    router.define(web, handler: webHandler, transitionType: TransitionType.cupertino);
    router.define(setting, handler: settingHandler, transitionType: TransitionType.cupertino);
    router.define(todo, handler: todoHandler, transitionType: TransitionType.cupertino);
    router.define(myPoint, handler: myPointHandler, transitionType: TransitionType.cupertino);
    router.define(myCollect, handler: myCollectHandler, transitionType: TransitionType.cupertino);
    router.define(login, handler: loginHandler, transitionType: TransitionType.cupertino);
    router.define(txList, handler: txListHandler, transitionType: TransitionType.cupertino);
    router.define(search, handler: searchHandler, transitionType: TransitionType.cupertino);
  }
}
